package com.henu.engineer.dao.mapper.student;

import com.henu.engineer.dao.entity.student.StudentScore;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author noexcept
 * @date 2021/7/27 11:36
 */
@Mapper
@Repository
public interface StudentScoreXmlMapper {

    boolean insertStudentScore(StudentScore student);

    Integer insertStudentScores(List<StudentScore> scoreList);

    /**
     * 查询某学生某课程得分
     */
    StudentScore selectStudentCourseScore(String id, String courseId);

    /**
     * 查询某学生所有课程成绩
     * @param id 学号
     * @return {@code List<Map<String,Double>>}键有{@code "name"}和{@code "score"}，对应的值分别为课程名和分数
     */
    List<Map<String,Double>> selectStudentScores(String id);

    /**
     * 查询某个课程所有学生的成绩
     * @param courseId
     * @return
     */
    List<StudentScore> selectStudentScoresByCourse(String courseId);

    /**
     * 更改某学生某课程的分数
     * @param studentId
     * @param courseId
     * @return
     */
    boolean updateStudentScore(String studentId,String courseId,Double score);


}
